package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

@TableName("t_details")
public class DetailsBean {
    /**
     * 明细编号
     */
    @TableId(value = "pk_detailsId",type = IdType.AUTO)
    private Integer id;
    /**
     * 所属订单编号
     */
    @TableField("fk_orderId")
    private Integer orderId;
    /**
     * 商品对象
     */
    @TableField(exist = false)
    private ProductBean productBean;
    /**
     * 商品数量
     */
    @TableField("d_num")
    private Integer num;

    public DetailsBean() {
    }

    public DetailsBean(Integer orderId, Integer productId, Integer num) {
        this.orderId = orderId;
        this.productBean = new ProductBean();
        this.productBean.setId(productId);
        this.num = num;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public ProductBean getProductBean() {
        return productBean;
    }

    public void setProductBean(ProductBean productBean) {
        this.productBean = productBean;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }
}
